Skip to content

Instantly share code, notes, and snippets.

@o11c
o11c / every-vm-tutorial-you-ever-studied-is-wrong.md
Last active August 29, 2026 05:27
Every VM tutorial you ever studied is wrong (and other compiler/interpreter-related knowledge)

Note: this was originally several Reddit posts, chained and linked. But now that Reddit is dying I've finally moved them out. Sorry about the mess.


URL: https://www.reddit.com/r/ProgrammingLanguages/comments/up206c/stack_machines_for_compilers/i8ikupw/ Summary: stack-based vs register-based in general.

There are a wide variety of machines that can be described as "stack-based" or "register-based", but not all of them are practical. And there are a lot of other decisions that affect that practicality (do variables have names or only address/indexes? fixed-width or variable-width instructions? are you interpreting the bytecode (and if so, are you using machine stack frames?) or turning it into machine code? how many registers are there, and how many are special? how do you represent multiple types of variable? how many scopes are there(various kinds of global, local, member, ...)? how much effort/complexity can you afford to put into your machine? etc.)

  • a pure stack VM can only access the top elemen
@mmozeiko
mmozeiko / !README.md
Last active August 29, 2026 05:23
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK from newest Visual Studio.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

pytensor-suite-feedstock

This is a conda-forge feedstock for PyTensor. The recipe produces two packages: pytensor-base (core, lightweight) and pytensor (adds compiler + BLAS deps).

Reviewing bot version-bump PRs

When the autotick bot opens a version-bump PR, verify that PyPI dependency changes are reflected in the recipe before merging.

@RobinCPC
RobinCPC / gdb_in_vim.md
Last active August 29, 2026 05:12
How to use GDB in Vim

How to use ConqueGDB in Vim

Install ConqueGDB in Vim

Debug C/C++:

# Claude Code CLI Environment Variables
# This file lists all environment variables used in v2.1.202 with explanations
## Anthropic API & Authentication
ANTHROPIC_API_KEY - Primary API key for Anthropic's Claude API; used as an auth source (source "ANTHROPIC_API_KEY") when no OAuth token is configured
ANTHROPIC_AUTH_TOKEN - Alternative bearer token for Anthropic services; sent as Authorization: Bearer and takes priority over ANTHROPIC_API_KEY, also used with gateway mode
ANTHROPIC_BASE_URL - Custom base URL for the Anthropic API; overrides the default api.anthropic.com endpoint (a non-api.anthropic.com host marks the client as non-first-party)
ANTHROPIC_BETAS - Comma-separated list of beta feature headers appended (trimmed, non-empty) to the internal beta flags on API requests
ANTHROPIC_CUSTOM_HEADERS - Custom HTTP headers for API requests, parsed as newline-separated "Key: Value" pairs
@ItsZariep
ItsZariep / My life without GTK4.md
Last active August 29, 2026 04:53
My life without GTK4

GTK4 was released in 2020 as an update to the already controversial GTK3. I was initially excited,until I saw how many traditional concepts were abandoned simply because the GNOME team decided they were "no longer useful."

Unfortunately, GTK4 apps look terrible in environments like IceWM, KDE Plasma, and Wayfire (which I use).

Is worse with libadwaita, where customization is nearly impossible,outside of setting the GTK_THEME environment variable.

To make matters worse, most GTK4 apps rely on poor Client-Side Decoration (CSD) designs that feel completely out of place outside GNOME.

These and other issues made me refuse to use GTK4-based applications. Instead, I've chosen to stick with software that still uses GTK3,or in some cases, apps that don’t use GTK at all but are still worth mentioning due to their quality and usability.

@fiddyschmitt
fiddyschmitt / gist:4e49019c8f10b267fb7f3284689f88c4
Last active August 29, 2026 04:50
ffmpeg - send and receive G.711 RTP audio
--list input devices
ffmpeg -list_devices true -f dshow -i dummy
--to record microphone to mp3
ffmpeg -f dshow -i audio="Microphone (Logitech USB Headset H340)" -c:a libmp3lame -ar 44100 -b:a 320k -ac 1 output1.mp3
--send mic to rtp multicast g.711
ffmpeg -f dshow -i audio="Microphone (Logitech USB Headset H340)" -ac 1 -ar 8000 -ab 64 -acodec pcm_mulaw -f rtp rtp://239.0.0.1:5656
--play received audio
@josephabrahams
josephabrahams / mavericks-iso.sh
Created September 13, 2014 22:20
Create a bootable ISO from the OS X Mavericks app
#!/bin/sh
# Create a bootable ISO from the OS X Mavericks app
# http://thezinx.com/misc/trend/create-bootable-dmg-iso-mavericks-app/
if [ ! -f /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg ]; then
echo "Download the OS X Mavericks App and then rerun this script."
open "https://itunes.apple.com/us/app/os-x-mavericks/id675248567"
exit 1
fi
@Ashton-W
Ashton-W / Issue.md
Last active August 29, 2026 04:30
GitHub Markdown toggle code block
Click to toggle contents of `code`
CODE!
Details